#include "unp.h"
#include "arp.h"
#include <netinet/ip.h>
#include <netinet/in.h>
#include <sys/ioctl.h>          /* ioctls */
#include <net/if.h>             /* generic interface structures */
#include <linux/if_ether.h>
#include <net/ethernet.h>       /* the L2 protocols */
#include <netpacket/packet.h>   /* added for sockaddr_ll - raw socket */
#include <assert.h>
#include <netinet/in_systm.h>
#include <netinet/ip_icmp.h>

#define IP_PACKET_LEN 4*1024
#define IPPROTO_GRP23 23
#define IPHDR_ID_GRP23 923
#define HOSTNAME_LEN 10
#define MC_IP "224.23.23.23"
#define MC_PORT 9923
#define MC_MSG_SIZE 4*1024
#define PING_BUFSIZE 1500
#define MC_MSG_EOT 1
#define MC_MSG_IDN 2

/* structure toured across the nodes */
struct tourhdr
{
	uint32_t 	tour_id;			//tour unique identifier
	char		tour_src_ip[INET_ADDRSTRLEN];	//tour source IP
	int		tour_len;			//tour length excluding src
	int		tour_nxt_idx;			//tour next node index
	char		multicast_ip[INET_ADDRSTRLEN];	//multicast ip chosen by src
	uint32_t	multicast_port;			//multicast port chosen by src
};

struct mcmsg
{
	char		msg[MC_MSG_SIZE];		//multicast message
	int		msg_type;			//end of tour flag
};

int lookup_hostbyname(char *hostname, char *cIP); 
char *lookup_hostbyip(char *cIP);
char *getlohostname();

